3.34 \(\int \csc ^3(e+f x) (a+b \tan ^2(e+f x)) \, dx\)

Optimal. Leaf size=51 \[ -\frac{(a+2 b) \tanh ^{-1}(\cos (e+f x))}{2 f}-\frac{a \cot (e+f x) \csc (e+f x)}{2 f}+\frac{b \sec (e+f x)}{f} \]

[Out]

-((a + 2*b)*ArcTanh[Cos[e + f*x]])/(2*f) - (a*Cot[e + f*x]*Csc[e + f*x])/(2*f) + (b*Sec[e + f*x])/f

________________________________________________________________________________________

Rubi [A]  time = 0.052528, antiderivative size = 51, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.19, Rules used = {3664, 455, 388, 207} \[ -\frac{(a+2 b) \tanh ^{-1}(\cos (e+f x))}{2 f}-\frac{a \cot (e+f x) \csc (e+f x)}{2 f}+\frac{b \sec (e+f x)}{f} \]

Antiderivative was successfully verified.

[In]

Int[Csc[e + f*x]^3*(a + b*Tan[e + f*x]^2),x]

[Out]

-((a + 2*b)*ArcTanh[Cos[e + f*x]])/(2*f) - (a*Cot[e + f*x]*Csc[e + f*x])/(2*f) + (b*Sec[e + f*x])/f

Rule 3664

Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^2)^(p_.), x_Symbol] :> With[{ff = Free
Factors[Sec[e + f*x], x]}, Dist[1/(f*ff^m), Subst[Int[((-1 + ff^2*x^2)^((m - 1)/2)*(a - b + b*ff^2*x^2)^p)/x^(
m + 1), x], x, Sec[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[(m - 1)/2]

Rule 455

Int[(x_)^(m_)*((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2), x_Symbol] :> Simp[((-a)^(m/2 - 1)*(b*c - a*d)*
x*(a + b*x^2)^(p + 1))/(2*b^(m/2 + 1)*(p + 1)), x] + Dist[1/(2*b^(m/2 + 1)*(p + 1)), Int[(a + b*x^2)^(p + 1)*E
xpandToSum[2*b*(p + 1)*x^2*Together[(b^(m/2)*x^(m - 2)*(c + d*x^2) - (-a)^(m/2 - 1)*(b*c - a*d))/(a + b*x^2)]
- (-a)^(m/2 - 1)*(b*c - a*d), x], x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && LtQ[p, -1] && IGtQ[
m/2, 0] && (IntegerQ[p] || EqQ[m + 2*p + 1, 0])

Rule 388

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[(d*x*(a + b*x^n)^(p + 1))/(b*(n*
(p + 1) + 1)), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(b*(n*(p + 1) + 1)), Int[(a + b*x^n)^p, x], x] /; FreeQ[{
a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && NeQ[n*(p + 1) + 1, 0]

Rule 207

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTanh[(Rt[b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])

Rubi steps

\begin{align*} \int \csc ^3(e+f x) \left (a+b \tan ^2(e+f x)\right ) \, dx &=\frac{\operatorname{Subst}\left (\int \frac{x^2 \left (a-b+b x^2\right )}{\left (-1+x^2\right )^2} \, dx,x,\sec (e+f x)\right )}{f}\\ &=-\frac{a \cot (e+f x) \csc (e+f x)}{2 f}-\frac{\operatorname{Subst}\left (\int \frac{-a-2 b x^2}{-1+x^2} \, dx,x,\sec (e+f x)\right )}{2 f}\\ &=-\frac{a \cot (e+f x) \csc (e+f x)}{2 f}+\frac{b \sec (e+f x)}{f}+\frac{(a+2 b) \operatorname{Subst}\left (\int \frac{1}{-1+x^2} \, dx,x,\sec (e+f x)\right )}{2 f}\\ &=-\frac{(a+2 b) \tanh ^{-1}(\cos (e+f x))}{2 f}-\frac{a \cot (e+f x) \csc (e+f x)}{2 f}+\frac{b \sec (e+f x)}{f}\\ \end{align*}

Mathematica [B]  time = 0.0448324, size = 123, normalized size = 2.41 \[ -\frac{a \csc ^2\left (\frac{1}{2} (e+f x)\right )}{8 f}+\frac{a \sec ^2\left (\frac{1}{2} (e+f x)\right )}{8 f}+\frac{a \log \left (\sin \left (\frac{1}{2} (e+f x)\right )\right )}{2 f}-\frac{a \log \left (\cos \left (\frac{1}{2} (e+f x)\right )\right )}{2 f}+\frac{b \sec (e+f x)}{f}+\frac{b \log \left (\sin \left (\frac{1}{2} (e+f x)\right )\right )}{f}-\frac{b \log \left (\cos \left (\frac{1}{2} (e+f x)\right )\right )}{f} \]

Antiderivative was successfully verified.

[In]

Integrate[Csc[e + f*x]^3*(a + b*Tan[e + f*x]^2),x]

[Out]

-(a*Csc[(e + f*x)/2]^2)/(8*f) - (a*Log[Cos[(e + f*x)/2]])/(2*f) - (b*Log[Cos[(e + f*x)/2]])/f + (a*Log[Sin[(e
+ f*x)/2]])/(2*f) + (b*Log[Sin[(e + f*x)/2]])/f + (a*Sec[(e + f*x)/2]^2)/(8*f) + (b*Sec[e + f*x])/f

________________________________________________________________________________________

Maple [A]  time = 0.08, size = 76, normalized size = 1.5 \begin{align*}{\frac{b}{f\cos \left ( fx+e \right ) }}+{\frac{b\ln \left ( \csc \left ( fx+e \right ) -\cot \left ( fx+e \right ) \right ) }{f}}-{\frac{\cot \left ( fx+e \right ) a\csc \left ( fx+e \right ) }{2\,f}}+{\frac{a\ln \left ( \csc \left ( fx+e \right ) -\cot \left ( fx+e \right ) \right ) }{2\,f}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(f*x+e)^3*(a+b*tan(f*x+e)^2),x)

[Out]

1/f*b/cos(f*x+e)+1/f*b*ln(csc(f*x+e)-cot(f*x+e))-1/2*a*cot(f*x+e)*csc(f*x+e)/f+1/2/f*a*ln(csc(f*x+e)-cot(f*x+e
))

________________________________________________________________________________________

Maxima [A]  time = 1.03911, size = 103, normalized size = 2.02 \begin{align*} -\frac{{\left (a + 2 \, b\right )} \log \left (\cos \left (f x + e\right ) + 1\right ) -{\left (a + 2 \, b\right )} \log \left (\cos \left (f x + e\right ) - 1\right ) - \frac{2 \,{\left ({\left (a + 2 \, b\right )} \cos \left (f x + e\right )^{2} - 2 \, b\right )}}{\cos \left (f x + e\right )^{3} - \cos \left (f x + e\right )}}{4 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^3*(a+b*tan(f*x+e)^2),x, algorithm="maxima")

[Out]

-1/4*((a + 2*b)*log(cos(f*x + e) + 1) - (a + 2*b)*log(cos(f*x + e) - 1) - 2*((a + 2*b)*cos(f*x + e)^2 - 2*b)/(
cos(f*x + e)^3 - cos(f*x + e)))/f

________________________________________________________________________________________

Fricas [B]  time = 1.96736, size = 325, normalized size = 6.37 \begin{align*} \frac{2 \,{\left (a + 2 \, b\right )} \cos \left (f x + e\right )^{2} -{\left ({\left (a + 2 \, b\right )} \cos \left (f x + e\right )^{3} -{\left (a + 2 \, b\right )} \cos \left (f x + e\right )\right )} \log \left (\frac{1}{2} \, \cos \left (f x + e\right ) + \frac{1}{2}\right ) +{\left ({\left (a + 2 \, b\right )} \cos \left (f x + e\right )^{3} -{\left (a + 2 \, b\right )} \cos \left (f x + e\right )\right )} \log \left (-\frac{1}{2} \, \cos \left (f x + e\right ) + \frac{1}{2}\right ) - 4 \, b}{4 \,{\left (f \cos \left (f x + e\right )^{3} - f \cos \left (f x + e\right )\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^3*(a+b*tan(f*x+e)^2),x, algorithm="fricas")

[Out]

1/4*(2*(a + 2*b)*cos(f*x + e)^2 - ((a + 2*b)*cos(f*x + e)^3 - (a + 2*b)*cos(f*x + e))*log(1/2*cos(f*x + e) + 1
/2) + ((a + 2*b)*cos(f*x + e)^3 - (a + 2*b)*cos(f*x + e))*log(-1/2*cos(f*x + e) + 1/2) - 4*b)/(f*cos(f*x + e)^
3 - f*cos(f*x + e))

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \tan ^{2}{\left (e + f x \right )}\right ) \csc ^{3}{\left (e + f x \right )}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)**3*(a+b*tan(f*x+e)**2),x)

[Out]

Integral((a + b*tan(e + f*x)**2)*csc(e + f*x)**3, x)

________________________________________________________________________________________

Giac [B]  time = 1.45158, size = 246, normalized size = 4.82 \begin{align*} \frac{2 \,{\left (a + 2 \, b\right )} \log \left (-\frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right ) - \frac{a{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac{a + \frac{14 \, b{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac{a{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} - \frac{2 \, b{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}}{\frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} + \frac{{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}}}{8 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^3*(a+b*tan(f*x+e)^2),x, algorithm="giac")

[Out]

1/8*(2*(a + 2*b)*log(-(cos(f*x + e) - 1)/(cos(f*x + e) + 1)) - a*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + (a +
14*b*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) - a*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2 - 2*b*(cos(f*x + e) -
 1)^2/(cos(f*x + e) + 1)^2)/((cos(f*x + e) - 1)/(cos(f*x + e) + 1) + (cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2
))/f